// SETUP

#include intrographics.txt
#include ladyluckbiggraphics.txt

setdatapath("data/graphics/cutscenes/inventor/");

var inventorgraphics = {
	idle: {
		animation: "inventor_idle.json",
		pack: "inventor.pck",
		loop: true
	},
	worried_idle: {
		animation: "inventor_worried_idle.json",
		pack: "inventor.pck",
		loop: true
	}
}
var inventor = addsprite("inventor", 1, inventorgraphics);

// HELPER FUNCTIONS	

var fade_time = 0.4;

// ACTORS
actor("Lady Luck", screenwidthmid + 800, 550, Col.YELLOW, CENTER, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
actor("Inventor", 2620, 780, 0xffe48d, CENTER, BOTTOM, "chat_inventor", "characters/inventor/charicon_inventor");

// INTRO

play("music_cutscene_lesscheery");

inventor.scale = 0.5;
inventor.x = 2570 - ((inventor.getwidth("idle") * inventor.scale) / 2);
inventor.y = 840;
changebackground("intro_stage");
fadein();
inventor.show("idle");

ladyluck_big.x = -screenwidth;
ladyluck_big.show("idle");
Actuate.tween(ladyluck_big, 2, { x: 0 }).ease(Expo.easeOut);
play("cutscene_audience");

wait(0.5);

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "Inventor, my determined little friend.");
speak("Lady Luck", "How are you getting on with my Dungeons?");
ladyluck_big.show("idle", true);

actor("Inventor", 2620, 780, 0xffe48d, CENTER, BOTTOM, "chat_inventor", "characters/inventor/charicon_inventor");
speak("Inventor", "You know, I’m not 100% sure they’re fair.");
speak("Inventor", "I think some episodes might|be harder than others.");

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
ladyluck_big.show("talking-thinking", true);
speak("Lady Luck", "Oh gosh! Surely not! How terribly unjust that would be.");
speak("Lady Luck", "I must look into it.");
ladyluck_big.show("idle", true);

speak("Inventor", "...and actually...");
speak("Inventor", "... the more I think about it the more it seems|like you must have realised already...");

ladyluck_big.show("talking", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 240, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "I don’t think that can possibly be true, my dear.");
ladyluck_big.show("talking-sly", true);
actor("Lady Luck", screenwidthmid + 240, screenheightmid - 280, Col.YELLOW, RIGHT, BOTTOM, "chat_ladyluck", "characters/misc/charicon_ladyluck");
speak("Lady Luck", "It doesn’t sound like me at all.");
speak("Lady Luck", "ANYWAY, in you go! Have a great episode!");
speak("Lady Luck", "Don’t get trapped forever!");
ladyluck_big.show("idle-sly", true);

startgamefromcutscene();